Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function calls with properties #114

Closed
wants to merge 11 commits into from
Closed

Conversation

JensOgorek
Copy link
Contributor

@JensOgorek JensOgorek commented Dec 5, 2024

This will change the mute(), unmute() and broadcast() call, so they also work with properties.

  • Implement module properties instead of variables -> module level properties, that can be changed as call or property
  • add call properties -> Properties that handle like calls
  • documentation

@JensOgorek JensOgorek self-assigned this Dec 5, 2024
@JensOgorek JensOgorek added the enhancement New feature or request label Dec 5, 2024
@JensOgorek JensOgorek linked an issue Dec 5, 2024 that may be closed by this pull request
@JensOgorek JensOgorek added this to the 0.6.2 milestone Dec 5, 2024
@JensOgorek
Copy link
Contributor Author

JensOgorek commented Dec 5, 2024

I tested it for Input, this solution works but might be not final, if I find a simpler solution.
Do we only want to do that with the default calls (from module) or module specific calls as well, like pullup, pulldown in Input? These need more coding, since they are not a simple bool setting.

Also, @falkoschindler yes, I need to change all modules again :D

Edit: The solution is smoother.

@JensOgorek
Copy link
Contributor Author

JensOgorek commented Dec 9, 2024

I added the most calls that only use one (or one with a default) parameter to be handled as a property by the proxy/expander. Some modules with multiple settings on different calls, like Input's pull modes are combined to pullmode.

It works like this

proxy_input = p0.Input(x)
proxy_input.pullmode="pullup" 

It now does the same as proxy_input.pullup(), but it will be saved in the property list inside the expander and will be resent to the expander, if it is rebooted.
The "call properties" are only saved on the proxy side, they are not saved on the expander itself (except the module was already saving something in the call). This makes no functional difference, since they still can be read directly, for example with proxy_input.pullmode.
Calls with two parameters are not supported, since we have no handling for multiple parameters. If we need it, we have to create a solution for expressions with multiple arguments, like ->evaluate_array() or a write_properties with a vector input.
Also, I don't know if we need all those calls to be "call properties", if they are too much, we can remove some.

@falkoschindler what do you think?

@JensOgorek JensOgorek marked this pull request as ready for review December 9, 2024 15:47
@JensOgorek
Copy link
Contributor Author

I will add the documentation, once we finalize what has to be added or removed and how we add the call properties to the documentation

Copy link
Collaborator

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to put this PR on hold and evaluate a different approach, pausing the execution while booting a port expander. This would avoid the need for keeping track of methods and properties.

@falkoschindler falkoschindler marked this pull request as draft December 11, 2024 13:52
@JensOgorek
Copy link
Contributor Author

JensOgorek commented Jan 8, 2025

Should we archive this now? Since #117 is merged into main? @falkoschindler

@JensOgorek JensOgorek closed this Jan 8, 2025
@falkoschindler falkoschindler deleted the function_calls_as_properties branch January 16, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle call functions like properties
2 participants